package factory

// 简单工厂
type SimpleFactory interface {
	create() string
}

// 自行车
type Bicycle struct{}

func (b *Bicycle) create() string {
	return "bicycle"
}

// 小汽车
type Car struct{}

func (c *Car) create() string {
	return "car"
}

func newFactory(t string) SimpleFactory {
	switch t {
	case "bicycle":
		return &Bicycle{}
	case "car":
		return &Car{}
	}
	return nil
}
